@import '../../style/mixin.less';

.send-token,
.transfer-nft {
  .page();
  padding: 0 20px 20px 20px;
  position: relative;
  .chain-tag-selector {
    margin-bottom: -10px;
  }
  .page-header {
    margin-bottom: 0;
    padding-top: 20px;
    align-items: center;
    font-weight: 900;
    color: var(--rb-neutral-title-1, #192945);
  }
  .section {
    margin-bottom: 20px;
    .section-title {
      display: flex;
      font-size: 17px;
      font-weight: 700;
      line-height: 18px;
      color: var(--r-neutral-title-1);
      margin-bottom: 12px;
      .token-balance {
        display: flex;
        align-items: center;
      }
    }

    .token-amount-input {
      margin-bottom: 0;
      padding: 20px;

      .left {
        padding: 8px 12px;
        border-radius: 100px;
        border-left: none;
        background: var(--r-neutral-card-2, #f2f4f7);
      }
      .left:hover {
        background: var(--r-blue-light2, #eef1ff);
      }
      .right .ant-input {
        font-weight: 700;
        font-size: 28px;
      }
    }
    .token-price {
      padding: 8px 0;
      font-weight: 400;
      font-size: 12px;
      line-height: 14px;
      text-align: right;
      color: var(--r-neutral-title-1, #192945);
    }
  }
  .account-card {
    height: 36px;
    padding: 0;
    background: var(--r-blue-light-1, #eef1ff);
    border-radius: 4px;
    margin-bottom: 10px;
    .title {
      display: none;
    }
    .icon-account {
      width: 20px;
      height: 20px;
      path {
        fill: var(--r-blue-default, #7084ff);
      }
    }
    .account-detail {
      height: 36px;
      width: 100%;
      padding: 10px 12px;
      background-color: var(--r-blue-light-1, #eef1ff);
      .send-text {
        color: var(--r-blue-default, #7084ff) !important;
      }
      .address-viewer-text,
      .amount {
        color: var(--r-blue-default, #7084ff) !important;
        font-size: 13px;
        line-height: 15px;
        font-weight: 500;
      }
    }
  }
  .ant-input {
    border: 1px solid var(--r-neutral-line, #d3d8e0);
    background: transparent;
    border-radius: 4px;
    padding: 10px 12px;
    font-weight: 500;
    font-size: 13px;
    line-height: 15px;
    color: var(--r-neutral-title-1, #192945);

    &::placeholder {
      color: var(--r-neutral-foot);
      font-weight: 400;
    }
  }
  .ant-form-item {
    margin: 0;
    &.ant-form-item-has-error {
      .ant-input {
        border-color: #f24822 !important;
        &:hover {
          border: 1px solid #f24822;
        }
      }
    }
  }
  .ant-form-item-has-error .ant-input:hover {
    background: var(--r-neutral-card-1, #fff);
  }
  .ant-form-item-explain,
  .ant-form-item-extra {
    min-height: auto;
  }
  .section-title__to {
    line-height: 20px;
  }
  .contact-info {
    display: flex;
    align-items: center;
    padding: 3px 6px;
    border: 0.5px solid rgba(134, 151, 255, 0.5);
    border-radius: 2px;
    color: var(--r-blue-default, #7084ff);
    font-size: 12px;
    line-height: 14px;
    cursor: pointer;
    background-color: transparent;
    transition: background-color 0.3s;
    .icon {
      width: 16px;
      height: 16px;
      margin-right: 4px;
    }
    &:hover {
      background-color: var(--r-blue-light-1, #eef1ff);
    }
    &.disabled {
      opacity: 0.5;
      cursor: default;
      &:hover {
        background-color: transparent;
      }
    }
  }
  .icon-contact {
    width: 20px;
    height: 20px;
    margin-left: 12px;
    cursor: pointer;
  }
  .token-input {
    padding: 14px 12px;
    background: @color-bg;
    border-radius: 4px;
    font-weight: 500;
    font-size: 15px;
    line-height: 18px;
    color: #161819;
    display: flex;
    margin-bottom: 6px;
    width: fit-content;

    .left {
      display: flex;
      align-items: center;
      position: relative;
      cursor: pointer;
      width: fit-content;
      .token-input__symbol {
        max-width: 50px;
        margin-left: 6px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .icon-arrow-down {
        width: 12px;
        height: 12px;
      }
      &::after {
        content: '';
        background-color: @color-border;
        width: 0.5px;
        height: 32px;
        position: absolute;
        right: 0;
        top: 50%;
        margin-top: -16px;
      }
    }
    .right {
      flex: 1;
      display: flex;
      justify-content: flex-end;
      align-items: center;
      .ant-input {
        padding: 0;
        text-align: right;
        font-weight: 500;
        font-size: 20px;
        line-height: 23px;
        border-radius: 0;
      }
    }
  }
  .token-info {
    margin-top: 15px;
    background: var(--r-neutral-card-2, rgba(255, 255, 255, 0.06));
    border-radius: 4px;
    padding: 12px;
    position: relative;
    z-index: 1;
    .section-field {
      display: flex;
      justify-content: space-between;
      font-size: 12px;
      line-height: 14px;
      color: var(--r-neutral-foot, #6a7587);
      margin-bottom: 8px;
      .address-viewer-text.normal {
        font-size: 12px;
        line-height: 14px;
        color: var(--r-neutral-foot, #6a7587);
        font-weight: normal;
        margin-right: 0;
      }
      .icon-copy {
        width: 14px;
        height: 14px;
        margin-left: 6px;
        cursor: pointer;
      }
      &:nth-last-child(1) {
        margin-bottom: 0;
      }
    }

    &::after {
      content: ' ';
      display: block;
      position: absolute;
      left: 16px;
      top: -16px;
      border: 6px solid transparent;
      border-bottom: 10px solid
        var(--r-neutral-card-2, rgba(255, 255, 255, 0.06));
      z-index: 0;
    }
  }
  .whitelist-alert {
    display: flex;
    font-weight: 400;
    font-size: 12px;
    line-height: 16px;
    color: var(--r-red-dark, #ae2a19);
    margin-top: 16px;
    margin-bottom: 16px;
    justify-content: center;
    .icon-check {
      width: 16px;
      height: 16px;
      margin-right: 4px;
    }
    &__content {
      max-width: 312px;
      margin-bottom: 0;
    }
    &.granted {
      color: var(--r-neutral-foot, #babec5);
    }
  }
  .token-validation {
    font-size: 12px;
    line-height: 14px;
    color: #ffb020;
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    .icon {
      width: 12px;
      height: 12px;
      margin-right: 6px;
      &.icon-loading {
        animation: spining 1.5s infinite linear;
        path {
          fill: #ffb020;
        }
      }
      &.icon-alert {
        path {
          stroke: #ec5151;
          &:nth-child(1) {
            stroke: transparent;
          }
        }
      }
    }
    &.faild {
      color: #ec5151;
    }
  }
  .balance-error {
    font-size: 12px;
    line-height: 14px;
    color: #f24822;
    text-align: right;
  }

  .address-tooltip {
    .ant-tooltip-inner {
      border-radius: 2px !important;
    }
    .ant-tooltip-arrow {
      display: block !important;
    }
  }
}

.send-token {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;

  .send-token-form {
    margin-left: -20px;
    margin-right: -20px;
    padding: 0 20px;
    position: relative;
    overflow: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .messagedata-input-wrapper {
    margin-top: 8px;
    margin-bottom: 8px;

    .ant-input {
      @border-w: 0.5px;
      border: @border-w solid var(--r-neutral-line, #d3d8e0);
      background: var(--r-neutral-card-2, #f2f4f7);
      line-height: 1.5;

      &:focus,
      &:hover {
        box-shadow: none;
        border-right-width: @border-w !important;
      }
    }
  }

  .footer {
    padding: 16px 0;
    margin-left: -20px;
    margin-right: -20px;
    background: var(--r-neutral-bg2, #f2f4f7);
    border-top: 0.5px solid var(--r-neutral-line, #d3d8e0);
  }

  .footer .whitelist-alert {
    margin-top: 0;
    margin-bottom: 16px;
  }
}

.send-token-gas-selector {
  .gas-selector {
    background: var(--r-neutral-card-2);
    border: 1px solid var(--r-neutral-line, #d3d8e0);
    border-radius: 6px;
    display: flex;
    margin-bottom: 20px;
    padding: 16px;
    flex-direction: column;

    .left {
      margin-right: 8px;
      .icon-gas {
        width: 16px;
        height: 16px;
      }
    }
    .gas-info {
      flex: 1;
      line-height: 1;
      p {
        margin-bottom: 4px;
        &:nth-last-child(1) {
          margin-bottom: 0;
        }
      }
    }
    .top {
      display: flex;
      align-items: center;
      position: relative;
      width: 100%;
      height: 18px;
      line-height: 18px;
      .usmoney {
        font-size: 15px;
        color: var(--r-neutral-title-1);
        line-height: 18px;
        font-weight: 500;
      }
      .gasmoney {
        font-size: 12px;
        color: var(--r-neutral-title-1);
        margin-left: 8px;
      }
    }
    .card-container {
      height: 48px;
      margin-top: 12px;
      display: flex;
      justify-content: space-between;
      width: 100%;

      .card {
        width: 76px;
        height: 48px;
        background: var(--r-neutral-card-1);
        border-radius: 4px;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: 0 4px;
        border: 1px solid transparent;
        &:nth-child(1) {
          margin-left: 0;
        }
        &:nth-last-child(1) {
          margin-right: 0;
        }
        &:hover {
          border: 1px solid var(--r-blue-default, #7084ff);
        }
        &.active {
          background: var(--r-blue-light-1, #eef1ff);
          border: 1px solid var(--r-blue-default, #7084ff);
        }
        .gas-level {
          text-align: center;
          font-size: 12px;
          line-height: 14px;
          color: var(--r-neutral-body, #3e495e);
          margin: 8px auto 0;
        }
        .cardTitle {
          .gas-level;
          color: var(--r-neutral-title-1) !important;
          font-size: 13px !important;
          margin: 4px auto 0;
          font-weight: 500;
          .ant-input {
            background: transparent !important;
            transition: none;
          }
        }
        .custom-input {
          margin: 4px auto 0;
        }
        .ant-input {
          text-align: center !important;
          font-size: 13px !important;
          padding-top: 0;
          font-weight: 500;
          &.active {
            color: var(--r-blue-default, #7084ff) !important;
          }
        }
        .ant-input:focus,
        .ant-input-focused {
          color: var(--r-neutral-title-1);
        }
      }
    }
  }
}
